<template>
  <el-dialog
    :title="dialogTittle"
    :visible.sync="dialogFormVisible"
    @opened="opened()"
    style="margin-top: -10vh;"
    width="1500px"
  >
    <div style="border:0px solid red;height: 900px;">
      <routeChart ref="routeChart"></routeChart>
    </div>
    <div
      slot="footer"
      class="dialog-footer"
      style="margin-top: 10PX;position: relative;"
    >
      <el-button @click="dialogFormVisible = false" type="primary">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
/* eslint-disable */
import routeChart from './index'
export default {
  name: "chartDialog",
  components: {routeChart },
  data () {
    return {
      chartData: {},
      dialogTittle: '',
      dialogFormVisible: false,
      model: {},
      list: []
    };
  },
  methods: {
    opened () {
      let {
        routeData,
        realPatternRouteData,
        patternList,
        greenwave,
        allPatternList
      } = {...this.chartData}
      let routeChart = this.$refs.routeChart
      routeChart.onPlanChart (routeData, patternList, greenwave, this.devicesData)
      routeChart.onRealtimeChart (realPatternRouteData, allPatternList, greenwave, this.devicesData)
    },
    show (bShow = true, chartData, routeName, devicesData) {
      this.dialogFormVisible = bShow
      this.chartData = chartData
      this.devicesData = devicesData
      this.dialogTittle = routeName + ' ' + this.$t('openatc.greenwaveoptimize.spaceGraph')
    }
  }
};
</script>


<style lang="scss" rel="stylesheet/scss" scoped>
</style>
